"""
FIVEDASH(TM) -- General Purpose Accounting Software
Copyright (C) 2008  Obol Software Pty Ltd

This program is free software: you can redistribute it and/or modify
it. For terms and conditions, see fivedash/license/license.txt

"""

import logging
import  logging.config


#Singleton pattern. Ensure the logger instance to be only one
class AppLogger:
            """
                Application log
            """
            __log_single = None                                                                                         #single instance
            __log_ini_file = '/usr/local/fivedash/etc/app_log.ini'        #log config file
            def __init__( self ):
                    if AppLogger.__log_single == None:
                            try:
                                    logging.config.fileConfig(AppLogger.__log_ini_file)
                            except:
                                    pass
                            AppLogger.__log_single = logging.getLogger(None)
            
            def getHandler(self):
                    return AppLogger.__log_single

logger = AppLogger().getHandler()
